<html>

<head>
    <title>index</title>
    <script type="text/javascript" src="scripts/signalr-client.js"></script>
    <script type="text/javascript" src="scripts/jquery.js"></script>

</head>

<body>
    <input type="text" value="1234" id="txt1" />
    <input type="button" value="click" id="btn1" />


    <script type="text/javascript">
        $(function () {
            let connection = new signalR.HubConnection('http://58.58.180.48:9923/chat');
            //let connection = new signalR.HubConnection("http://localhost:9923/chat");
            connection.on('send', data => {
                console.log(data);
            });
            connection.on("test", data => {
                console.log( data);
                alert(data);
            });

            connection.on("Connected",data=>{
                console.log("connected");
                console.log(data);
            });
            connection.on("Disconnect",data=>{
                console.log("Disconnect");
                console.log(data);
            })
            connection.start();
            // .then(() => connection.invoke('send', 'Hello'));
            $("#btn1").on("click", function () {
                //    connection.invoke("send","1111");
                connection.invoke("test", $("#txt1").val());
            });
        });
    </script>

</body>

</html>